const { sequelize } = require('./init')
const SEQ_PARAMETER = {
  timestamps: false,
  freezeTableName: true
}
const sys_user = sequelize.define(
  require('./models_type/sys_user').NAME,
  require('./models_type/sys_user').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)
const comp = sequelize.define(
  require('./models_type/comp').NAME,
  require('./models_type/comp').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)
const comp_lib = sequelize.define(
  require('./models_type/comp_lib').NAME,
  require('./models_type/comp_lib').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)
const data_source = sequelize.define(
  require('./models_type/data_source').NAME,
  require('./models_type/data_source').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)
const project = sequelize.define(
  require('./models_type/project').NAME,
  require('./models_type/project').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)
const page = sequelize.define(
  require('./models_type/page').NAME,
  require('./models_type/page').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const data_api = sequelize.define(
  require('./models_type/data_api').NAME,
  require('./models_type/data_api').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const data_sql = sequelize.define(
  require('./models_type/data_sql').NAME,
  require('./models_type/data_sql').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const data_csv = sequelize.define(
  require('./models_type/data_csv').NAME,
  require('./models_type/data_csv').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const data_etl = sequelize.define(
  require('./models_type/data_etl').NAME,
  require('./models_type/data_etl').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const chat_group_info = sequelize.define(
  require('./models_type/chat_group_info').NAME,
  require('./models_type/chat_group_info').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 1
  },
)

const chat_group_message = sequelize.define(
  require('./models_type/chat_group_message').NAME,
  require('./models_type/chat_group_message').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 1
  },
)

const chat_group_user_relation = sequelize.define(
  require('./models_type/chat_group_user_relation').NAME,
  require('./models_type/chat_group_user_relation').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 1
  },
)

const chat_new_friends = sequelize.define(
  require('./models_type/chat_new_friends').NAME,
  require('./models_type/chat_new_friends').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 1
  },
)

const chat_private_message = sequelize.define(
  require('./models_type/chat_private_message').NAME,
  require('./models_type/chat_private_message').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 1
  },
)

const chat_user_relation = sequelize.define(
  require('./models_type/chat_user_relation').NAME,
  require('./models_type/chat_user_relation').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 1
  },
)

const _define = {
  sys_user,
  comp,
  comp_lib,
  data_source,
  data_api,
  data_sql,
  data_csv,
  project,
  page,
  data_etl,
  chat_group_info,
  chat_group_message,
  chat_group_user_relation,
  chat_new_friends,
  chat_private_message,
  chat_user_relation
}

module.exports = {
  ..._define,
  sequelize
}
